//
//  UIBarButtonItem+CustomButton.h
//  Whistle
//
//  Created by ZhangAo on 15/12/18.
//  Copyright © 2015年 BookSir. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIBarButtonItemSubItem : NSObject

@property (nonatomic, copy) NSString *title;
@property (nonatomic, strong) UIImage *image;

@property (nonatomic, strong) id target;
@property (nonatomic, assign) SEL selector;

@end

@interface UIBarButtonItem (CustomButton)

+ (instancetype)navigationBackButtonItemWithTitle:(NSString *)title
                                           target:(id)target
                                         selector:(SEL)selector;

+ (instancetype)navigationBackButtonItemWithTitle:(NSString *)title
                                            image:(UIImage *)image
                                           target:(id)target
                                         selector:(SEL)selector;

+ (instancetype)barButtonItemWithTitle:(NSString *)title
								target:(id)target
							  selector:(SEL)selector;

+ (instancetype)transparentBarButtonItemWithTitle:(NSString *)title
                                           target:(id)target
                                         selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
								target:(id)target
							  selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
                        highlightImage:(UIImage *)highlightImage
                                target:(id)target
                              selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
                        highlightImage:(UIImage *)highlightImage
                                 title:(NSString *)title
                                target:(id)target
                              selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
						highlightImage:(UIImage *)highlightImage
						  disableImage:(UIImage *)disableImage
								target:(id)target
							  selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
                        highlightImage:(UIImage *)highlightImage
                          disableImage:(UIImage *)disableImage
                               minSize:(CGFloat)minSize
                                target:(id)target selector:(SEL)selector;

+ (instancetype)barButtonItemWithImage:(UIImage *)image
						highlightImage:(UIImage *)highlightImage
                          disableImage:(UIImage *)disableImage
								 title:(NSString *)title
                               minSize:(CGFloat)minSize
								target:(id)target
							  selector:(SEL)selector;

+ (instancetype)barButtonItemWithItems:(NSArray<UIBarButtonItemSubItem *> *)items;

- (void)updateButtonTitle:(NSString *)title;

- (void)updateButtonColor:(UIColor *)color;

- (void)updateButtonTarget:(id)target selector:(SEL)selector;

- (UIButton *)customButton;

// 样式定制

+ (void)setCommonBadgeColor:(UIColor *)badgeColor;

+ (void)setCommonFontName:(NSString *)fontName;

+ (void)setCommonButtonTitleHighlightColor:(UIColor *)buttonTitleHighlightColor;

+ (void)setCommonButtonTitleColor:(UIColor *)buttonTitleColor;

@end
